/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giant.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author david
 */
@Entity
@Table(name = "type_currency")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TypeCurrency.findAll", query = "SELECT t FROM TypeCurrency t"),
    @NamedQuery(name = "TypeCurrency.findByIdTypeCurrency", query = "SELECT t FROM TypeCurrency t WHERE t.idTypeCurrency = :idTypeCurrency"),
    @NamedQuery(name = "TypeCurrency.findByCode", query = "SELECT t FROM TypeCurrency t WHERE t.code = :code"),
    @NamedQuery(name = "TypeCurrency.findByDescription", query = "SELECT t FROM TypeCurrency t WHERE t.description = :description"),
    @NamedQuery(name = "TypeCurrency.findBySymbol", query = "SELECT t FROM TypeCurrency t WHERE t.symbol = :symbol"),
    @NamedQuery(name = "TypeCurrency.findByUniversal", query = "SELECT t FROM TypeCurrency t WHERE t.universal = :universal"),
    @NamedQuery(name = "TypeCurrency.findByAbreviation", query = "SELECT t FROM TypeCurrency t WHERE t.abreviation = :abreviation")})
public class TypeCurrency implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_type_currency")
    private Integer idTypeCurrency;
    @Basic(optional = false)
    @NotNull
    @Column(name = "code")
    private int code;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 256)
    @Column(name = "description")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "symbol")
    private String symbol;
    @Basic(optional = false)
    @NotNull
    @Column(name = "universal")
    private boolean universal;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "abreviation")
    private String abreviation;

    public TypeCurrency() {
    }

    public TypeCurrency(Integer idTypeCurrency) {
        this.idTypeCurrency = idTypeCurrency;
    }

    public TypeCurrency(Integer idTypeCurrency, int code, String description, String symbol, boolean universal, String abreviation) {
        this.idTypeCurrency = idTypeCurrency;
        this.code = code;
        this.description = description;
        this.symbol = symbol;
        this.universal = universal;
        this.abreviation = abreviation;
    }

    public Integer getIdTypeCurrency() {
        return idTypeCurrency;
    }

    public void setIdTypeCurrency(Integer idTypeCurrency) {
        this.idTypeCurrency = idTypeCurrency;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSymbol() {
        return symbol;
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol;
    }

    public boolean getUniversal() {
        return universal;
    }

    public void setUniversal(boolean universal) {
        this.universal = universal;
    }

    public String getAbreviation() {
        return abreviation;
    }

    public void setAbreviation(String abreviation) {
        this.abreviation = abreviation;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTypeCurrency != null ? idTypeCurrency.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TypeCurrency)) {
            return false;
        }
        TypeCurrency other = (TypeCurrency) object;
        if ((this.idTypeCurrency == null && other.idTypeCurrency != null) || (this.idTypeCurrency != null && !this.idTypeCurrency.equals(other.idTypeCurrency))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.giant.entities.TypeCurrency[ idTypeCurrency=" + idTypeCurrency + " ]";
    }
    
}
